from copy import deepcopy
from core.basic.skill import 技能
from core.basic.character import Character
from core.basic.skill import 主动技能, 被动技能


class 剑魂主动技能(主动技能):
    hit数 = 0  # 太刀时所需参数，计算期望刺伤

    神剑术倍率 = 1.0

    def 额外刺伤层数(self, 武器类型):
        return 0

    def 穿云刺数量(self, 武器类型):
        return 0


class 剑魂流系技能(主动技能):
    hit数 = 0

    神剑术倍率 = 1.0

    def 武器CD系数(self, 武器类型, 输出类型):
        return 1.0  # 流系列技能不受武器CD影响

    def 额外刺伤层数(self, 武器类型):
        return 0

    def 穿云刺数量(self, 武器类型):
        return 0


class 技能0(被动技能):
    名称 = '基础精通'
    倍率 = 1.0
    所在等级 = 1
    等级上限 = 200
    学习间隔 = 1
    等级精通 = 110
    关联技能 = ['里鬼剑术', '空中连斩']

    def 加成倍率(self, 武器类型):
        if self.等级 == 0:
            return 1.0
        else:
            return round(self.倍率 * (0.463 + 0.089 * self.等级), 5)


class 技能1(剑魂主动技能):
    名称 = '空中连斩'
    备注 = '单次伤害(太刀一次挥舞动作是两次伤害)'
    所在等级 = 5
    等级上限 = 11
    学习间隔 = 1
    等级精通 = 1

    # 实际的空中连斩第一次为跳跃攻击，后续才为空中连斩的伤害
    data0 = [0, 195, 209, 221, 234, 247, 260, 275, 286, 299, 312, 326]
    hit0 = 1
    CD = 1.0
    TP成长 = 0.1
    TP上限 = 5
    hit数 = 2

    太刀附加 = 0

    def 等效百分比(self, **argv):
        武器类型 = argv.get('武器类型', '光剑')
        char = argv.get('char', {})
        if 武器类型 != '太刀':
            self.hit0 = 1
        else:
            self.太刀附加 = char.get_skill_by_name('太刀精通').太刀附加(武器类型)
            self.hit0 = (self.data0[self.等级] - 100 +
                         self.太刀附加) / self.data0[self.等级] * 2 * 1.5
        return super().等效百分比(**argv)

    def 穿云刺数量(self, 武器类型):
        return 1


class 技能2(剑魂主动技能):
    名称 = '里鬼剑术'
    所在等级 = 15
    等级上限 = 11
    学习间隔 = 15
    等级精通 = 1
    MP = [6, 140]

    data0 = [0]*12
    data = {
        '短剑': [0, 1092, 1123, 1156, 1189, 1222, 1254, 1288, 1319, 1353, 1385, 1419],
        '光剑': [0, 968, 994, 1024, 1052, 1082, 1112, 1140, 1170, 1196, 1226, 1256],
        '巨剑': [0, 1348, 1387, 1426, 1466, 1505, 1549, 1588, 1629, 1668, 1707, 1751],
        '钝器': [0, 1336, 1372, 1412, 1453, 1493, 1535, 1575, 1615, 1653, 1693, 1733],
        '太刀': [0, 1308, 1344, 1382, 1422, 1464, 1502, 1540, 1578, 1620, 1660, 1698]
    }
    # 巨剑不蓄力伤害下降
    CD = 1.0
    TP成长 = 0.1
    TP上限 = 5
    hit数 = 8

    穿云刺 = {'短剑': 3, '光剑': 3, '巨剑': 2, '钝器': 4, '太刀': 4}

    附加百分比 = 0

    def 武器百分比修正(self, 武器类型):
        # 国服特色回收
        return self.武器倍率.get(武器类型, 1.0)/1.05

    def 等效百分比(self, **argv):
        武器类型 = argv.get('武器类型', '光剑')
        self.data0 = self.data[武器类型]
        return super().等效百分比(**argv)

    # 里鬼附加伤害
    def 特殊技能加成(self, char, 武器类型):
        self.附加百分比 = 0
        self.hit1 = 0
        if 武器类型 == '巨剑':
            self.附加百分比 = char.get_skill_by_name('巨剑精通').里鬼附加百分比(武器类型)
            self.hit1 = 1
        if 武器类型 == '短剑':
            self.附加百分比 = char.get_skill_by_name('短剑精通').里鬼附加百分比(武器类型)
            self.hit1 = 3
        self.data1 = [0] + [self.附加百分比]*11

    def 穿云刺数量(self, 武器类型):
        return self.穿云刺[武器类型]


class 技能3(被动技能):
    名称 = '武器奥义'
    所在等级 = 15
    等级上限 = 30
    学习间隔 = 3
    等级精通 = 20
    关联技能 = ['无']


class 技能4(被动技能):
    名称 = '光剑掌握'
    所在等级 = 15
    等级上限 = 20
    学习间隔 = 3
    等级精通 = 10
    关联技能 = ['无']
    冷却关联技能 = ['所有']
    非冷却关联技能 = ['极鬼剑术暴风式', '万剑归宗', '万剑极诣开天斩']

    def CD缩减倍率(self, 武器类型):
        if self.等级 == 0 or 武器类型 != '光剑':
            return 1.0
        else:
            return round(1.0 - 0.01 * self.等级, 5)


class 技能5(被动技能):
    名称 = '短剑精通'
    所在等级 = 15
    等级上限 = 2
    学习间隔 = 3
    等级精通 = 1
    # 物理攻击力增加
    data1 = [0, 16.8, 18.3, 19.8, 21.3, 22.8, 24.3, 25.8, 27.3, 28.8, 30.3, 31.8, 33.3, 34.8, 36.3, 37.8, 39.3, 40.8, 42.3, 43.8, 45.3, 46.8, 48.3, 50.3, 52.3, 54.3, 56.3, 58.3, 60.3, 62.3, 64.3, 66.3, 68.3, 70.3, 72.3, 74.3, 76.3, 78.3, 80.3, 82.3, 84.3]
    # 魔法攻击力增加
    data2 = [0, 1.2, 2.6, 3.9, 5.1, 6.4, 7.7, 9, 10.3, 11.6, 12.9, 14.1, 15.4, 16.7, 18, 19.3, 20.6, 21.9, 23.1, 24.4, 25.7, 27, 28.3, 29.6, 30.9, 32.1, 33.4, 34.7, 36, 37.3, 38.6, 39.9, 41.1, 42.4, 43.7, 45, 46.3, 47.6, 48.9, 50.1, 51.4]
    # [里 · 鬼剑术]剑气攻击力
    data3 = [0, 419, 433, 445, 458, 470, 481, 495, 506, 520, 531, 541, 556, 566, 582, 591, 602, 617, 628, 642, 653, 664, 678, 689, 703, 714, 726, 739, 751, 765, 776, 788, 801, 813, 826, 838, 848, 863, 873, 888, 898]

    def 物理攻击力倍率(self, 武器类型):
        if 武器类型 != '短剑':
            return 1.0
        else:
            return round(self.data1[self.等级] / 100 + 1, 3)

    def 魔法攻击力倍率(self, 武器类型):
        if 武器类型 != '短剑':
            return 1.0
        else:
            return round(self.data2[self.等级] / 100 + 1, 3)

    # [里 · 鬼剑术]剑气攻击力 一轮3段
    def 里鬼附加百分比(self, 武器类型):
        if 武器类型 != '短剑':
            return 0
        else:
            return self.data3[self.等级]

    def 等级加成(self, x, char={}):
        if self.等级 != 0:
            self.等级 += x


class 技能6(被动技能):
    名称 = '太刀精通'
    所在等级 = 15
    等级上限 = 2
    学习间隔 = 3
    等级精通 = 1

    # 物理攻击力增加
    data1 = [0, 9.2, 10.7, 12.2, 13.7, 15.2, 16.7, 18.2, 19.7, 21.2, 22.7, 24.2, 25.7, 27.2, 28.7, 30.2, 31.7, 33.2, 34.7, 36.2, 37.7, 39.2, 40.7, 42.7, 44.7, 46.7, 48.7, 50.7, 52.7, 54.7, 56.7, 58.7, 60.7, 62.7, 64.7, 66.7, 68.7, 70.7, 72.7, 74.7, 76.7]
    # 魔法攻击力增加
    data2 = [0, 1.3, 2.8, 4.1, 5.4, 6.8, 8.2, 9.6, 10.9, 12.3, 13.7, 15, 16.4, 17.7, 19.1, 20.5, 21.9, 23.3, 24.5, 25.9, 27.3, 28.7, 30.1, 31.4, 32.8, 34.1, 35.5, 36.9, 38.2, 39.6, 41, 42.4, 43.7, 45, 46.4, 47.8, 49.2, 50.6, 52, 53.2, 54.6]
    # 刺伤几率
    data3 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, 50, 50, 51, 51, 52, 52]
    # 刺伤爆炸伤害(下限)
    data4 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2484, 2639, 2795, 2951, 3103, 3258, 3410, 3568, 3722, 3877, 4029, 4188, 4340, 4499, 4648, 4806, 4957, 5113, 5270, 5423, 5579, 5732, 5885, 6044, 6196, 6355, 6506, 6665, 6820, 6975, 7132]
    # 刺伤爆炸伤害(上限)
    data5 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17258, 18332, 19406, 20479, 21554, 22627, 23700, 24775, 25849, 26921, 27996, 29071, 30143, 31218, 32289, 33363, 34436, 35511, 36584, 37657, 38732, 39806, 40878, 41953, 43028, 44100, 45175, 46247, 47322, 48397, 49469]
    # 刺伤持续伤害
    data6 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 15, 15, 17, 17, 17, 18, 18, 18, 18, 18]
    # [空中连斩]附加攻击力
    data7 = [0, 63, 68, 72, 76, 79, 84, 87, 93, 96, 99, 104, 107, 111, 115, 120, 123, 127, 131, 134, 138, 143, 147, 150, 155, 159, 161, 166, 171, 174, 177, 183, 186, 190, 196, 198, 202, 204, 209, 214, 219]

    def 物理攻击力倍率(self, 武器类型):
        if 武器类型 != '太刀':
            return 1.0
        else:
            return round(self.data1[self.等级] / 100 + 1, 3)

    def 魔法攻击力倍率(self, 武器类型):
        if 武器类型 != '太刀':
            return 1.0
        else:
            return round(self.data2[self.等级] / 100 + 1, 3)

    def 刺伤概率(self, 武器类型):
        if 武器类型 != '太刀':
            return 0
        else:
            return self.data3[self.等级] / 100

    def 等级加成(self, x, char={}):
        if self.等级 != 0:
            if self.等级 + x > self.等级上限:
                self.等级 = self.等级上限
                if self.基础等级 != self.等级上限 and self.关联技能 != ['无']:
                    self.等级溢出 = 1
            else:
                self.等级 += x

    # 17层结算一次
    刺伤层数 = 0
    刺伤浮动 = 1

    def 刺伤百分比(self, 武器类型):
        if 武器类型 != '太刀':
            return 0
        else:
            return self.刺伤浮动 * self.刺伤层数 / 17 * self.data5[self.等级]

    # [空中连斩]附加攻击力
    def 太刀附加(self, 武器类型):
        if 武器类型 != '太刀':
            return 0
        else:
            return self.data7[self.等级]

    def 等级加成(self, x, char={}):
        if self.等级 != 0:
            self.等级 += x


class 技能7(被动技能):
    名称 = '巨剑精通'
    所在等级 = 15
    等级上限 = 2
    学习间隔 = 3
    等级精通 = 1

    # 物理攻击力增加
    data1 = [0, 14.4, 15.9, 17.4, 18.9, 20.4, 21.9, 23.4, 24.9, 26.4, 27.9, 29.4, 30.9, 32.4, 33.9, 35.4, 36.9, 38.4, 39.9, 41.4, 42.9, 44.4, 45.9, 47.9, 49.9, 51.9, 53.9, 55.9, 57.9, 59.9, 61.9, 63.9, 65.9, 67.9, 69.9, 71.9, 73.9, 75.9, 77.9, 79.9, 81.9]
    # 魔法攻击力增加
    data2 = [0, 1.4, 3.1, 4.6, 6, 7.5, 9, 10.6, 12.1, 13.6, 15.1, 16.5, 18.1, 19.6, 21.1, 22.6, 24.2, 25.7, 27.1, 28.6, 30.2, 31.7, 33.2, 34.7, 36.3, 37.7, 39.2, 40.7, 42.2, 43.8, 45.3, 46.8, 48.2, 49.8, 51.3, 52.8, 54.3, 55.9, 57.4, 58.8, 60.3]
    # [里 · 鬼剑术]额外附加
    data3 = [0, 656, 695, 729, 763, 802, 835, 873, 908, 942, 980, 1014, 1048, 1087, 1121, 1153, 1194, 1226, 1264, 1299, 1332, 1370, 1405, 1439, 1478, 1511, 1549, 1584, 1618, 1656, 1690, 1724, 1762, 1797, 1830, 1869, 1903, 1940, 1976, 2008, 2046]

    def 物理攻击力倍率(self, 武器类型):
        if 武器类型 != '巨剑':
            return 1.0
        else:
            return round(self.data1[self.等级] / 100 + 1, 3)

    def 魔法攻击力倍率(self, 武器类型):
        if 武器类型 != '巨剑':
            return 1.0
        else:
            return round(self.data2[self.等级] / 100 + 1, 3)

    def 里鬼附加百分比(self, 武器类型):
        if 武器类型 != '巨剑':
            return 0
        else:
            return self.data3[self.等级]

    def 等级加成(self, x, char={}):
        if self.等级 != 0:
            self.等级 += x


class 技能8(被动技能):
    名称 = '钝器精通'
    所在等级 = 15
    等级上限 = 2
    学习间隔 = 3
    等级精通 = 1
    # 物理攻击力增加
    data1 = [0, 11.3, 12.8, 14.3, 15.8, 17.3, 18.8, 20.3, 21.8, 23.3, 24.8, 26.3, 27.8, 29.3, 30.8, 32.3, 33.8, 35.3, 36.8, 38.3, 39.8, 41.3, 42.8, 44.8, 46.8, 48.8, 50.8, 52.8, 54.8, 56.8, 58.8, 60.8, 62.8, 64.8, 66.8, 68.8, 70.8, 72.8, 74.8, 76.8, 78.8]
    # 魔法攻击力增加
    data2 = [0, 1.4, 2.9, 4.4, 5.8, 7.3, 8.7, 10.2, 11.7, 13.2, 14.6, 16, 17.5, 18.9, 20.4, 21.9, 23.4, 24.8, 26.2, 27.7, 29.1, 30.6, 32.1, 33.6, 35, 36.4, 37.9, 39.3, 40.8, 42.3, 43.8, 45.2, 46.6, 48.1, 49.6, 51, 52.5, 54, 55.4, 56.8, 58.3]

    def 物理攻击力倍率(self, 武器类型):
        if 武器类型 != '钝器':
            return 1.0
        else:
            return round(self.data1[self.等级] / 100 + 1, 3)

    def 魔法攻击力倍率(self, 武器类型):
        if 武器类型 != '钝器':
            return 1.0
        else:
            return round(self.data2[self.等级] / 100 + 1, 3)

    def 等级加成(self, x, char={}):
        if self.等级 != 0:
            self.等级 += x


class 技能9(被动技能):
    名称 = '光剑精通'
    所在等级 = 15
    等级上限 = 2
    学习间隔 = 3
    等级精通 = 1
    # 物理攻击力增加
    data1 = [0, 9.5, 11, 12.5, 14, 15.5, 17, 18.5, 20, 21.5, 23, 24.5, 26, 27.5, 29, 30.5, 32, 33.5, 35, 36.5, 38, 39.5, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77]
    # 魔法攻击力增加
    data2 = [0, 2.5, 3.8, 5, 6.3, 7.6, 8.8, 10.1, 11.3, 12.6, 13.9, 15.1, 16.4, 17.6, 18.9, 20.2, 21.4, 22.7, 23.9, 25.2, 26.5, 27.7, 29, 30.2, 31.5, 32.8, 34, 35.3, 36.5, 37.8, 39.1, 40.3, 41.6, 42.8, 44.1, 45.4, 46.6, 47.9, 49.1, 50.4, 51.7]

    def 物理攻击力倍率(self, 武器类型):
        if 武器类型 != '光剑':
            return 1.0
        else:
            return round(self.data1[self.等级] / 100 + 1, 3)

    def 魔法攻击力倍率(self, 武器类型):
        if 武器类型 != '光剑':
            return 1.0
        else:
            return round(self.data2[self.等级] / 100 + 1, 3)


class 技能10(剑魂流系技能):
    名称 = '流心刺'
    所在等级 = 20
    等级上限 = 70
    学习间隔 = 2
    等级精通 = 60
    CD = 8
    MP = [30, 280]
    无色消耗 = 0
    data0 = [0, 2400, 2642, 2888, 3131, 3375, 3620, 3860, 4104, 4349, 4596, 4839, 5082, 5327, 5571, 5814, 6057, 6298, 6543, 6787, 7029, 7275, 7516, 7761, 8005, 8250, 8494, 8739, 8979, 9221, 9464, 9710, 9955, 10198, 10442, 10685, 10925, 11168, 11413, 11657, 11902, 12148, 12391, 12632, 12876, 13118, 13362, 13607, 13850, 14093, 14337, 14580, 14825, 15068, 15311, 15554, 15796, 16041, 16285, 16528, 16773, 17017, 17260, 17502, 17746, 17991, 18234, 18477, 18720, 18962, 19207]
    TP成长 = 0.1
    TP上限 = 7

    武器倍率 = {'短剑': 2 + 1, '光剑': 4 * 0.63, '巨剑': 2 +
            1, '钝器': 2 * 1.25, '太刀': 4 * 0.63}

    # 95被动相关
    地面被动倍率 = {'短剑': 1.0, '光剑': 1.0, '巨剑': 1.0, '钝器': 1.0, '太刀': 1.0}
    空中被动倍率 = {'短剑': 1.0, '光剑': 1.0, '巨剑': 1.0, '钝器': 1.0, '太刀': 1.0}

    hit数 = 4
    刺伤几率 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87]
    可附加的刺伤数量 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]

    def 额外刺伤层数(self, 武器类型):
        return int(self.刺伤几率[self.等级]) / 100 * self.可附加的刺伤数量[self.等级]

    def 穿云刺数量(self, 武器类型):
        return 2

    # 形态 = ['地面', '空中']

    def 形态变更(self, 形态, char: Character):
        # if 形态 == '' and len(self.形态) > 0:
        #     形态 = self.形态[0]
        # if 形态 == "地面":
        #     self.武器倍率 = {'短剑': 2 + 1, '光剑': 4 * 0.63,
        #                  '巨剑': 2 + 1, '钝器': 2 * 1.25, '太刀': 4 * 0.63}
        #     self.power0 = self.地面被动倍率[char.武器类型]
        # elif 形态 == "空中":
        #     self.武器倍率 = {'短剑': 2, '光剑': 2, '巨剑': 2, '钝器': 2 * 1.25, '太刀': 2}
        #     self.power0 = self.空中被动倍率[char.武器类型]
        #     self.hit数 = 2

        # 2023.10.26 使空中使用时的总攻击力与地面施放时相同
        self.武器倍率 = {'短剑': 2 + 1, '光剑': 4 * 0.63,
                         '巨剑': 2 + 1, '钝器': 2 * 1.25, '太刀': 4 * 0.63}
        self.power0 = self.地面被动倍率[char.武器类型]

class 技能11(被动技能):
    名称 = '无我剑气'
    所在等级 = 20
    等级上限 = 15
    学习间隔 = 3
    等级精通 = 5

    def 加成倍率(self, 武器类型):
        if self.等级 == 0:
            return 1.0
        else:
            return round(1.00 + 0.02 * self.等级, 5)


class 技能12(剑魂流系技能):
    名称 = '流心跃'
    所在等级 = 25
    等级上限 = 70
    学习间隔 = 2
    等级精通 = 60
    CD = 8
    MP = [30, 350]
    无色消耗 = 0
    data0 = [0, 6653, 7328, 8001, 8676, 9351, 10028, 10705, 11380, 12055, 12729, 13404, 14080, 14755, 15430, 16107, 16782, 17456, 18130, 18806, 19481, 20156, 20831, 21505, 22181, 22857, 23533, 24204, 24882, 25557, 26230, 26906, 27582, 28256, 28932, 29607, 30278, 30955, 31628, 32306, 32983, 33657, 34331, 35007, 35681, 36355, 37033, 37706, 38381, 39057, 39732, 40407, 41082, 41758, 42433, 43107, 43782, 44457, 45135, 45810, 46485, 47161, 47833, 48508, 49183, 49858, 50535, 51210, 51884, 52560, 53235]
    hit0 = 1
    TP成长 = 0.1
    TP上限 = 7

    武器倍率 = {'短剑': 2 * 0.5, '光剑': 1, '巨剑': 1, '钝器': 1, '太刀': 2 * 0.5}

    # 95被动相关
    地面被动倍率 = {'短剑': 1.0, '光剑': 1.0, '巨剑': 1.0, '钝器': 1.0, '太刀': 1.0}
    空中被动倍率 = {'短剑': 1.0, '光剑': 1.0, '巨剑': 1.0, '钝器': 1.0, '太刀': 1.0}

    hit数 = 2
    刺伤几率 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 100, 100, 100, 100]
    可附加的刺伤数量 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4]

    def 额外刺伤层数(self, 武器类型):
        return int(self.刺伤几率[self.等级]) / 100 * self.可附加的刺伤数量[self.等级]

    def 穿云刺数量(self, 武器类型):
        return 2

    形态 = ['地面', '空中']

    def 形态变更(self, 形态, char: Character):
        if 形态 == '' and len(self.形态) > 0:
            形态 = self.形态[0]
        if 形态 == "地面":
            self.武器倍率['钝器'] = 1.0
        elif 形态 == "空中":
            self.武器倍率['钝器'] = 1.2
        self.power0 = self.空中被动倍率[char.武器类型]


class 技能13(剑魂主动技能):
    名称 = '流心狂'
    所在等级 = 30
    等级上限 = 20
    学习间隔 = 3
    等级精通 = 10
    是否有伤害 = 0
    MP = [20, 168]
    关联技能 = ['流心刺', '流心跃', '流心升']

    def 加成倍率(self, 武器类型):
        if self.等级 == 0:
            return 1.0
        else:
            return round(1.20 + 0.02 * self.等级, 5)


class 技能14(剑魂流系技能):
    名称 = '流心升'
    所在等级 = 30
    等级上限 = 70
    学习间隔 = 2
    等级精通 = 60
    CD = 8
    MP = [50, 490]
    无色消耗 = 0
    data0 = [0, 3949, 4350, 4754, 5153, 5555, 5957, 6356, 6757, 7157, 7557, 7961, 8363, 8761, 9162, 9562, 9966, 10365, 10766, 11169, 11569, 11968, 12373, 12770, 13172, 13573, 13975, 14376, 14776, 15174, 15578, 15979, 16378, 16781, 17182, 17582, 17982, 18382, 18786, 19186, 19585, 19986, 20388, 20791, 21192, 21591, 21992, 22393, 22792, 23193, 23597, 23998, 24398, 24798, 25200, 25600, 25998, 26406, 26805, 27204, 27605, 28007, 28406, 28808, 29208, 29611, 30011, 30410, 30812, 31213, 31614]
    hit0 = 1
    TP成长 = 0.1
    TP上限 = 7

    武器倍率 = {'短剑': 1 + 1.1, '光剑': 3 * 0.8,
            '巨剑': 1 + 1.1, '钝器': 1 + 1.1, '太刀': 3 * 0.8}

    hit数 = 3
    刺伤几率 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4]
    可附加的刺伤数量 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9]

    def 额外刺伤层数(self, 武器类型):
        return int(self.刺伤几率[self.等级]) / 100 * self.可附加的刺伤数量[self.等级]

    def 穿云刺数量(self, 武器类型):
        return 2


class 技能15(剑魂主动技能):
    名称 = "破军升龙击"
    所在等级 = 30
    等级上限 = 70
    学习间隔 = 2
    等级精通 = 60
    CD = 10
    MP = [70, 700]
    无色消耗 = 0
    data0 = [0, 1749, 1927, 2104, 2282, 2457, 2637, 2815, 2990, 3169, 3345, 3524, 3700, 3877, 4056, 4233, 4410, 4588, 4764, 4944, 5122, 5299, 5477, 5652, 5831, 6008, 6186, 6364, 6542, 6719, 6895, 7073, 7252, 7432, 7604, 7784, 7962, 8139, 8319, 8495, 8673, 8849, 9028, 9207, 9383, 9562, 9739, 9915, 10092, 10269, 10448, 10626, 10800, 10981, 11157, 11333, 11509, 11688, 11865, 12045, 12224, 12401, 12579, 12753, 12931, 13112, 13285, 13464, 13641, 13819, 13996]
    data1 = [0, 2701, 2973, 3246, 3520, 3795, 4069, 4341, 4615, 4890, 5163, 5440, 5713, 5984, 6261, 6533, 6808, 7082, 7356, 7628, 7902, 8177, 8451, 8725, 8995, 9274, 9547, 9821, 10096, 10369, 10639, 10916, 11190, 11464, 11738, 12009, 12284, 12560, 12834, 13108, 13383, 13657, 13928, 14201, 14476, 14750, 15024, 15296, 15571, 15844, 16122, 16396, 16666, 16940, 17215, 17490, 17764, 18035, 18309, 18584, 18859, 19133, 19406, 19679, 19953, 20228, 20502, 20777, 21050, 21324, 21598]
    TP成长 = 0.1
    TP上限 = 7

    # 光剑下破军升龙击冲撞攻击力实际为面板的0.89，但游戏中并未有相关说明
    冲撞倍率 = {'短剑': 2, '光剑': 4*0.89, '巨剑': 2, '钝器': 2, '太刀': 2}
    上斩倍率 = {'短剑': 1, '光剑': 1, '巨剑': 3, '钝器': 3, '太刀': 2}
    武器倍率 = {'短剑': 1.45, '光剑': 1, '巨剑': 1, '钝器': 1, '太刀': 1}

    独立倍率 = 1.0

    def 等效百分比(self, **argv):
        武器类型 = argv.get('武器类型', '光剑')
        self.hit0 = self.冲撞倍率[武器类型]
        self.hit1 = self.上斩倍率[武器类型]
        return super().等效百分比(**argv)

    # 极神剑术被动相关,短剑影响;与上斩数据相关
    def 极神剑术占比(self, 武器类型):
        if self.等级 == 0:
            return 0
        return self.data1[self.等级] * (1 + self.TP成长 * self.TP等级) * self.技攻 * self.倍率 * self.武器百分比修正(武器类型=武器类型) / self.等效百分比(武器类型=武器类型)

    hit数 = 3
    刺伤几率 = [0, 0, 0, 0, 310, 320, 330, 340, 350, 360, 370, 380, 390, 400, 410, 420, 430, 440, 450, 460, 470, 480, 490, 500, 510, 520, 530, 540, 550, 560, 570, 580, 590, 600, 610, 620,
            630, 640, 650, 660, 670, 680, 690, 700, 710, 720, 730, 740, 750, 760, 770, 780, 790, 800, 810, 820, 830, 840, 850, 860, 870, 880, 890, 900, 910, 920, 930, 940, 950, 960, 970]
    可附加的刺伤数量 = [0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
                2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]

    def 额外刺伤层数(self, 武器类型):
        return self.刺伤几率[self.等级] / 1000 * self.可附加的刺伤数量[self.等级]


class 技能16(剑魂主动技能):
    名称 = "拔刀斩"
    所在等级 = 35
    等级上限 = 70
    学习间隔 = 2
    等级精通 = 60
    CD = 15
    MP = [110, 924]
    无色消耗 = 1
    data0 = [0, 8646, 9528, 10405, 11281, 12157, 13034, 13915, 14791, 15668, 16546, 17421, 18301, 19178, 20055, 20931, 21809, 22685, 23564, 24442, 25318, 26197, 27075, 27951, 28831, 29708, 30586, 31463, 32339, 33215, 34094, 34969, 35849, 36728, 37604, 38481, 39358, 40236, 41114, 41990, 42866, 43745, 44625, 45501, 46379, 47257, 48133, 49011, 49887, 50766, 51642, 52519, 53397, 54275, 55154, 56030, 56908, 57785, 58664, 59538, 60417, 61296, 62172, 63050, 63927, 64804, 65685, 66560, 67436, 68315, 69190]
    hit0 = 1
    TP成长 = 0.1
    TP上限 = 5

    武器倍率 = {'短剑': 1.4, '光剑': 1.3, '巨剑': 1.3, '钝器': 1.3, '太刀': 1.25}

    是否有护石 = 1
    触发神影手 = 0

    # 拔刀奥义
    # 准备动作时间 -30%
    # 短剑 : 剑气的拔刀斩攻击力比率 +28%
    # 太刀 : 追加攻击的拔刀斩攻击力比率 +25%
    # 钝器 : 追加攻击的拔刀斩攻击力比率 +26%
    # 巨剑 : [巨剑精通]最大蓄气时[拔刀斩]攻击力增加量 +26%
    # 光剑 : 追加攻击的拔刀斩攻击力比率 +26%
    # 攻击成功时发动[神影手] (一次[拔刀斩]最多发动1次)
    # 攻击范围 +20%
    # 攻击力 +5%

    def 装备护石(self, char):
        self.武器倍率 = {'短剑': 1.4 + 0.28, '光剑': 1.3 + 0.26,
                     '巨剑': 1.3 + 0.26, '钝器': 1.3 + 0.26, '太刀': 1.25 + 0.25}
        self.倍率 *= 1.12
        self.触发神影手 = 1

    hit数 = 2
    刺伤几率 = [0, 0, 0, 0, 0, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100]
    可附加的刺伤数量 = [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10]
    追加刺伤几率 = [0, 0, 0, 0, 0, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100]
    追加可附加的刺伤数量 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7]

    def 额外刺伤层数(self, 武器类型):
        return int(self.刺伤几率[self.等级]) / 100 * self.可附加的刺伤数量[self.等级] + self.追加刺伤几率[self.等级] / 100 * self.追加可附加的刺伤数量[self.等级]


class 技能17(剑魂主动技能):
    名称 = '破军斩龙击'
    所在等级 = 40
    等级上限 = 70
    学习间隔 = 2
    等级精通 = 60

    data0 = [0, 4507, 4964, 5423, 5881, 6336, 6793, 7252, 7708, 8164, 8628, 9081, 9540, 9999, 10455, 10911, 11371, 11828, 12285, 12740, 13200, 13658, 14113, 14573, 15030, 15488, 15944, 16404, 16859, 17316, 17775, 18232, 18687, 19148, 19605, 20063, 20517, 20977, 21434, 21891, 22350, 22807, 23264, 23721, 24179, 24634, 25095, 25552, 26011, 26465, 26923, 27383, 27839, 28293, 28755, 29210, 29671, 30129, 30586, 31043, 31499, 31958, 32415, 32873, 33330, 33787, 34244, 34702, 35159, 35618, 36074]
    hit0 = 1
    data1 = [0, 5410, 5959, 6507, 7056, 7607, 8157, 8701, 9254, 9801, 10352, 10899, 11449, 11999, 12546, 13094, 13641, 14193, 14744, 15291, 15842, 16389, 16938, 17486, 18035, 18587, 19136, 19684, 20233, 20781, 21330, 21880, 22429, 22975, 23527, 24075, 24622, 25176, 25722, 26272, 26821, 27365, 27919, 28464, 29014, 29567, 30112, 30665, 31210, 31757, 32306, 32862, 33407, 33955, 34504, 35054, 35604, 36153, 36700, 37253, 37798, 38348, 38898, 39446, 39995, 40542, 41092, 41640, 42192, 42741, 43287]
    hit1 = 1
    data2 = [0, 8116, 8942, 9762, 10585, 11408, 12233, 13056, 13881, 14705, 15529, 16349, 17172, 17997, 18821, 19646, 20468, 21290, 22114, 22937, 23761, 24584, 25409, 26234, 27055, 27877, 28703, 29527, 30350, 31170, 31996, 32821, 33642, 34464, 35290, 36111, 36933, 37760, 38582, 39409, 40233, 41055, 41875, 42701, 43523, 44348, 45171, 45997, 46815, 47640, 48464, 49288, 50113, 50935, 51759, 52581, 53403, 54229, 55052, 55877, 56702, 57522, 58346, 59171, 59993, 60816, 61640, 62462, 63286, 64108, 64935]
    hit2 = 1
    TP成长 = 0.10
    TP上限 = 5
    CD = 25.0

    MP = [30, 450]
    无色消耗 = 1

    hit数 = 4
    刺伤几率 = [0, 36, 39, 42, 45, 48, 51, 54, 57, 60, 63, 66, 69, 72, 75, 78, 81, 84, 87, 90, 93, 96, 99, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100]
    可附加的刺伤数量 = [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8]

    def 额外刺伤层数(self, 武器类型):
        return int(self.刺伤几率[self.等级]) / 100 * self.可附加的刺伤数量[self.等级]

    def 穿云刺数量(self, 武器类型):
        return 5


class 技能18(剑魂主动技能):
    名称 = "猛龙断空斩"
    所在等级 = 40
    等级上限 = 70
    学习间隔 = 2
    等级精通 = 60
    CD = 20
    MP = [25, 420]
    无色消耗 = 1
    data0 = [0, 2663, 2936, 3206, 3475, 3747, 4017, 4286, 4556, 4827, 5096, 5367, 5637, 5910, 6181, 6451, 6718, 6992, 7262, 7530, 7802, 8072, 8343, 8612, 8884, 9155, 9425, 9694, 9966, 10236, 10505, 10776, 11047, 11315, 11586, 11858, 12128, 12398, 12668, 12940, 13210, 13480, 13750, 14022, 14290, 14560, 14830, 15102, 15372, 15642, 15915, 16185, 16454, 16725, 16996, 17264, 17536, 17803, 18076, 18348, 18618, 18890, 19159, 19429, 19700, 19970, 20239, 20511, 20779, 21052, 21322]
    hit0 = 2
    data1 = [0, 3914, 4313, 4710, 5107, 5502, 5901, 6298, 6697, 7091, 7490, 7887, 8282, 8684, 9079, 9475, 9874, 10270, 10666, 11064, 11462, 11860, 12255, 12652, 13053, 13448, 13847, 14244, 14640, 15038, 15435, 15833, 16230, 16626, 17023, 17422, 17820, 18216, 18611, 19011, 19406, 19804, 20201, 20599, 20995, 21393, 21791, 22189, 22583, 22982, 23379, 23776, 24174, 24570, 24968, 25366, 25760, 26159, 26556, 26955, 27350, 27747, 28147, 28544, 28938, 29339, 29734, 30130, 30530, 30928, 31325]
    hit1 = 2
    TP成长 = 0.1
    TP上限 = 5

    武器倍率 = {'短剑': 1.25, '光剑': 1.0, '巨剑': 1.0, '钝器': 1.0, '太刀': 1.0}

    hit数 = 4 + 8
    旋风攻击次数 = 4 * 2
    是否有护石 = 1

    独立倍率 = 1.0

    # 极神剑术被动相关,短剑影响
    def 极神剑术占比(self, 武器类型):
        if self.等级 == 0:
            return 0
        return self.data0[self.等级] * (1 + self.TP成长 * self.TP等级) * self.技攻 * self.倍率 * self.武器百分比修正(武器类型=武器类型) / self.等效百分比(武器类型=武器类型)

    # 猛龙过江
    # 巴恩的飓风强化 (学习[极 · 神剑术]后发动)
    # - 移动时追击周围敌人
    # - 持续时间 +1秒
    # - 多段攻击次数上限 +5
    # - 攻击力 -57%
    # - 突进上斩动作结束时生成旋风
    # - 大小 +80%
    # - 多段攻击次数上限 +2次

    def 装备护石(self, char):
        self.hit数 = 4 + 11 * 3
        self.旋风攻击次数 = 11 * 3 * 0.43
        self.倍率 *= 1.07


class 技能19(剑魂主动技能):
    名称 = "幻影剑舞"
    所在等级 = 45
    等级上限 = 70
    学习间隔 = 2
    等级精通 = 60
    CD = 45
    MP = [360, 3024]
    无色消耗 = 2
    data0 = [0, 989, 1092, 1194, 1294, 1393, 1497, 1594, 1695, 1798, 1895, 1996, 2097, 2201, 2301, 2399, 2500, 2603, 2705, 2803, 2904, 3004, 3104, 3206, 3308, 3408, 3507, 3609, 3711, 3811, 3911, 4011, 4110, 4214, 4312, 4413, 4517, 4613, 4715, 4818, 4917, 5018, 5117, 5220, 5320, 5420, 5521, 5623, 5720, 5823, 5926, 6025, 6127, 6226, 6328, 6428, 6528, 6628, 6728, 6830, 6929, 7032, 7133, 7234, 7334, 7435, 7534, 7634, 7736, 7834, 7934]
    data1 = [0, 3969, 4370, 4773, 5175, 5578, 5983, 6384, 6787, 7190, 7591, 7998, 8395, 8797, 9206, 9605, 10009, 10411, 10812, 11216, 11618, 12021, 12426, 12827, 13229, 13631, 14034, 14434, 14838, 15243, 15646, 16049, 16451, 16853, 17256, 17656, 18063, 18464, 18865, 19270, 19673, 20074, 20476, 20876, 21282, 21686, 22089, 22491, 22893, 23295, 23698, 24101, 24503, 24907, 25309, 25708, 26117, 26517, 26917, 27322, 27723, 28128, 28528, 28931, 29337, 29738, 30141, 30545, 30945, 31348, 31753]
    TP成长 = 0.1
    TP上限 = 5

    是否有护石 = 1
    影子斩击次数 = 4

    独立倍率 = 1.0

    # 这里的武器倍率已经被计算入内
    斩击倍率 = {'短剑': 12 * 0.9, '光剑': 24 * 0.75,
            '巨剑': 12 * 1.5, '钝器': 12, '太刀': 24 * 0.75}
    剑气倍率 = {'短剑': 4 * 1.2, '光剑': 3, '巨剑': 3, '钝器': 4.2, '太刀': 3}

    def 等效百分比(self, **argv):
        武器类型 = argv.get('武器类型', '光剑')
        self.hit0 = self.斩击倍率[武器类型]
        self.hit1 = self.剑气倍率[武器类型]
        return super().等效百分比(**argv)

    # 极神剑术被动相关,武器倍率不影响
    def 极神剑术斩击占比(self, 武器类型):
        return self.data0[self.等级] * (1 + self.TP成长 * self.TP等级) * self.技攻 * self.倍率 / self.等效百分比(武器类型=武器类型)

    # 极神剑术被动相关,武器倍率不影响
    def 极神剑术剑气占比(self, 武器类型):
        return self.data1[self.等级] * (1 + self.TP成长 * self.TP等级) * self.技攻 * self.倍率 / self.等效百分比(武器类型=武器类型)

    hit数 = 24 + 3 + 4 + 3  # 本体斩击:24  本体剑气:3  影子斩击:4  影子剑气:3
    刺伤几率 = [0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35]
    可附加的刺伤数量 = [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]

    def 额外刺伤层数(self, 武器类型):
        return int(self.刺伤几率[self.等级]) / 100 * self.可附加的刺伤数量[self.等级] * (24 + 3)

    def 穿云刺数量(self, 武器类型):
        return 4

    # 无形剑舞
    # 攻击范围 +25%
    # 幻影斩击多段攻击次数 +8次
    # 施放过程中所受伤害 -90%
    # 幻影斩击多段攻击次数 +5次

    def 装备护石(self, char):
        self.倍率 *= 1.06
        self.影子斩击次数 += 13
        self.hit数 += 13


class 技能20(被动技能):
    名称 = '极鬼剑术斩铁式'
    所在等级 = 48
    等级上限 = 50
    学习间隔 = 3
    等级精通 = 40

    关联技能 = ['所有']

    def 加成倍率(self, 武器类型):
        if self.等级 == 0:
            return 1.0
        else:
            return round(0.995 + 0.03 + 0.02 * self.等级, 5)


class 技能21(剑魂主动技能):
    名称 = '极鬼剑术暴风式'
    所在等级 = 50
    等级上限 = 50
    学习间隔 = 5
    等级精通 = 40
    CD = 145
    MP = [980, 8232]
    无色消耗 = 5
    data0 = [0, 5659, 6969, 8282, 9594, 10908, 12219, 13533, 14846, 16158, 17469, 18784, 20095, 21408, 22721, 24036, 25348, 26657, 27970, 29283, 30594, 31906, 33218, 34533, 35847, 37157, 38470, 39785, 41095, 42408, 43722, 45034, 46348, 47657, 48968, 50281, 51596, 52907, 54217, 55532, 56842, 58157, 59470, 60783, 62096, 63407, 64719, 66033, 67346, 68656, 69968]
    hit0 = 1
    data1 = [0, 2693, 3320, 3942, 4570, 5190, 5821, 6443, 7067, 7695, 8318, 8943, 9570, 10193, 10820, 11446, 12069, 12692, 13319, 13944, 14569, 15193, 15821, 16442, 17070, 17691, 18320, 18941, 19568, 20193, 20820, 21444, 22068, 22694, 23318, 23941, 24570, 25192, 25818, 26442, 27068, 27692, 28318, 28944, 29568, 30193, 30816, 31443, 32068, 32693, 33316]
    hit1 = 24
    data2 = [0, 10508, 12947, 15386, 17824, 20256, 22697, 25136, 27572, 30007, 32445, 34885, 37322, 39757, 42195, 44636, 47071, 49509, 51946, 54384, 56821, 59256, 61697, 64135, 66571, 69006, 71444, 73885, 76320, 78759, 81194, 83634, 86070, 88509, 90946, 93384, 95820, 98255, 100696, 103129, 105570, 108006, 110443, 112879, 115319, 117754, 120194, 122631, 125069, 127508, 129942]
    hit2 = 1

    hit数 = 26

    def 等效百分比(self, **argv):
        if self.等级 >= 9:
            self.倍率 = 1.1
        return super().等效百分比(**argv)


class 技能22(剑魂主动技能):
    名称 = '极神剑术流星落'
    所在等级 = 60
    等级上限 = 50
    学习间隔 = 2
    等级精通 = 40
    CD = 35
    MP = [420, 1200]
    无色消耗 = 1
    data0 = [0, 4113, 4534, 4949, 5369, 5784, 6205, 6619, 7038, 7456, 7872, 8291, 8709, 9125, 9543, 9962, 10377, 10795, 11216, 11630, 12048, 12466, 12885, 13301, 13720, 14134, 14554, 14972, 15389, 15804, 16223, 16642, 17058, 17477, 17894, 18308, 18728, 19145, 19566, 19981, 20400, 20814, 21235, 21654, 22068, 22488, 22904, 23319, 23738, 24159, 24575]
    hit0 = 1
    data1 = [0, 755, 833, 911, 988, 1063, 1142, 1219, 1295, 1374, 1449, 1529, 1602, 1683, 1759, 1835, 1912, 1989, 2064, 2139, 2220, 2295, 2369, 2452, 2528, 2603, 2681, 2757, 2834, 2910, 2989, 3064, 3143, 3219, 3295, 3372, 3448, 3525, 3603, 3682, 3758, 3836, 3911, 3987, 4065, 4141, 4215, 4296, 4371, 4449, 4527]
    hit1 = 38
    data2 = [0, 8230, 9067, 9900, 10734, 11573, 12406, 13241, 14078, 14911, 15744, 16585, 17415, 18249, 19089, 19924, 20757, 21594, 22428, 23261, 24101, 24931, 25766, 26603, 27438, 28272, 29110, 29943, 30775, 31611, 32448, 33280, 34120, 34954, 35786, 36624, 37459, 38291, 39131, 39964, 40801, 41634, 42468, 43304, 44139, 44976, 45809, 46646, 47480, 48315, 49150]
    hit2 = 1
    TP成长 = 0.1
    TP上限 = 5
    是否有护石 = 1

    流星之天剑倍率 = 1.0  # 极神剑术被动相关

    独立倍率 = 1.0

    hit数 = 40
    流星之天剑刺伤层数 = 0  # 极神剑术被动相关
    刺伤几率 = [0, 29, 32, 35, 38, 41, 44, 47, 50, 53, 56, 59, 62, 65, 68, 71, 74, 77, 80, 83, 86, 89, 92, 95, 98, 101, 104, 107, 110, 113, 116, 119, 122, 125, 128, 131, 134, 137, 140, 143, 146, 149, 152, 155, 158, 161, 164, 167, 170, 173, 176]
    可附加的刺伤数量 = [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]

    def 额外刺伤层数(self, 武器类型):
        return min(self.刺伤几率[self.等级] / 100, 1) * self.可附加的刺伤数量[self.等级] + self.流星之天剑刺伤层数

    # 流星审判
    # 跳跃冲击波攻击强制控制敌人1.5秒
    # 跳跃动作变更为无敌状态， 落地后增加1秒无敌时间
    # 投掷流星剑前置准备时间 -50%
    # 流星剑间隔 -20%
    # 流星剑数量 +9个
    # 流星剑和流星之天剑攻击范围 +55%
    # 流星之天剑攻击力 +35%
    # 流星之天剑强制控制时间 +60%

    def 装备护石(self, char):
        self.hit数 += 9
        self.hit1 += 9
        self.流星之天剑倍率 = 2.05


class 技能23(剑魂主动技能):
    名称 = '破空拔刀斩'
    所在等级 = 70
    等级上限 = 50
    学习间隔 = 2
    等级精通 = 40
    CD = 50
    MP = [800, 1680]
    无色消耗 = 2
    data0 = [0, 45284, 49878, 54469, 59066, 63657, 68255, 72848, 77442, 82036, 86631, 91223, 95819, 100415, 105006, 109600, 114193, 118787, 123383, 127975, 132570, 137165, 141758, 146354, 150947, 155541, 160136, 164729, 169324, 173913, 178512, 183105, 187700, 192294, 196890, 201481, 206077, 210669, 215265, 219858, 224452, 229047, 233640, 238232, 242830, 247422, 252018, 256610, 261205, 265799, 270392]
    hit0 = 1
    data1 = [0, 40764, 44897, 49033, 53167, 57303, 61440, 65575, 69709, 73848, 77982, 82118, 86251, 90387, 94523, 98654, 102795, 106929, 111064, 115197, 119335, 123472, 127606, 131740, 135879, 140015, 144149, 148286, 152417, 156551, 160686, 164824, 168960, 173094, 177229, 181364, 185502, 189637, 193773, 197909, 202046, 206180, 210316, 214449, 218585, 222718, 226858, 230991, 235126, 239259, 243395]
    hit1 = 1
    TP成长 = 0.1
    TP上限 = 5

    是否有护石 = 1

    MP = [800, 1680]
    无色消耗 = 2

    hit数 = 1
    刺伤几率 = [0, 31, 35, 39, 43, 47, 51, 55, 59, 63, 67, 71, 75, 79, 83, 87, 91, 95, 99, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100]
    可附加的刺伤数量 = [0, 3, 3, 3, 5, 5, 5, 7, 7, 7, 9, 9, 9, 11, 11, 11, 13, 13, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15]

    def 额外刺伤层数(self, 武器类型):
        return int(self.刺伤几率[self.等级]) / 100 * self.可附加的刺伤数量[self.等级]

    形态 = ['近距离', '剑气']

    def 形态变更(self, 形态, char: Character):
        if 形态 == '' and len(self.形态) > 0:
            形态 = self.形态[0]
        if 形态 == "近距离":
            self.power0 = 1
            self.power1 = 0
        elif 形态 == "剑气":
            self.power0 = 0
            self.power1 = 1
    # 破空一刀
    # 剑气攻击适用与近距离击打相同的攻击力
    # 准备动作时间 -40%
    # 冷却时间 -10%
    # 剑气生成后僵直 -20%
    # 攻击力 +11%

    def 装备护石(self, char):
        self.data1 = self.data0
        self.倍率 *= 1.19
        self.CDR *= 0.9


class 技能24(被动技能):
    名称 = '神影手'
    所在等级 = 70
    等级上限 = 1
    学习间隔 = 1
    等级精通 = 1
    关联技能 = ['无']
    百分比 = 4080


class 技能25(剑魂主动技能):
    名称 = '极神剑术破空斩'
    所在等级 = 75
    等级上限 = 50
    学习间隔 = 2
    等级精通 = 40
    CD = 35
    MP = [580, 4500]
    无色消耗 = 3
    data0 = [0, 7229, 7962, 8698, 9428, 10164, 10895, 11629, 12361, 13098, 13829, 14563, 15296, 16033, 16765, 17495, 18232, 18963, 19699, 20430, 21165, 21897, 22631, 23365, 24098, 24831, 25564, 26298, 27032, 27765, 28498, 29233, 29968, 30699, 31434, 32165, 32903, 33634, 34368, 35100, 35835, 36566, 37301, 38035, 38767, 39499, 40233, 40968, 41701, 42436, 43166]
    data1 = [0, 24098, 26542, 28988, 31434, 33878, 36321, 38767, 41211, 43657, 46101, 48549, 50990, 53435, 55882, 58327, 60771, 63219, 65661, 68107, 70549, 72995, 75441, 77885, 80328, 82775, 85220, 87663, 90111, 92555, 94999, 97444, 99890, 102335, 104781, 107225, 109668, 112113, 114556, 117004, 119445, 121896, 124337, 126784, 129227, 131674, 134117, 136564, 139008, 141452, 143896]

    是否有护石 = 1
    # 武器倍率已计入
    多段倍率 = {'短剑': 5, '光剑': 6, '巨剑': 5 * 1.08, '钝器': 5, '太刀': 6}
    爆炸倍率 = {'短剑': 1, '光剑': 1, '巨剑': 1.08, '钝器': 1, '太刀': 1}
    # def 等效百分比(self, 武器类型):
    #     return (self.多段倍率[武器类型] * self.data1[self.等级] + self.爆炸倍率[武器类型] * self.data2[self.等级]) * self.技攻 * self.倍率

    # 极神剑术被动相关,巨剑蓄力会影响
    def 等效百分比(self, **argv):
        武器类型 = argv.get('武器类型', '光剑')
        self.hit0 = self.多段倍率[武器类型]
        self.hit1 = self.爆炸倍率[武器类型]
        return super().等效百分比(**argv)

    # 极神剑术被动相关,巨剑蓄力会影响
    def 极神剑术占比(self, 武器类型):
        if self.等级 == 0:
            return 0
        return self.爆炸倍率[武器类型] * self.data1[self.等级] * self.技攻 * self.倍率 / self.等效百分比(武器类型=武器类型)

    hit数 = 7
    刺伤几率 = [0, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 127, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149, 151]
    可附加的刺伤数量 = [0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]

    def 额外刺伤层数(self, 武器类型):
        return min(self.刺伤几率[self.等级] / 1000, 1) * self.可附加的刺伤数量[self.等级]

    def 穿云刺数量(self, 武器类型):
        return 4

    def 装备护石(self, char):
        self.data1 = [i * 1.62 for i in self.data1]


class 技能26(被动技能):
    名称 = '极神剑术'
    所在等级 = 75
    等级上限 = 50
    学习间隔 = 3
    等级精通 = 40

    额外倍率 = 1.0

    关联技能 = ['拔刀斩', '破军斩龙击', '极鬼剑术暴风式', '破空拔刀斩',
            '极神剑术瞬斩', '万剑归宗', '极神剑术无形斩', '万剑极诣开天斩']

    def 加成倍率(self, 武器类型):
        if self.等级 == 0:
            return 1.0
        else:
            return round(1.22 + 0.02 * self.等级, 5)

    # 基础值 40%
    暴风式冲击波 = [0, 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 148, 152, 156, 160, 164, 168, 172, 176, 180, 184, 188, 192, 196]
    # 基础值 21%
    飓风 = [0, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98]
    # 基础值 55%
    幻影斩击 = [0, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120, 125, 130, 135, 140, 145, 150, 155, 160, 165, 170, 175, 180, 185, 190, 195, 200, 205, 210, 215, 220, 225, 230, 235, 240, 245]
    # 基础值 55%
    幻影剑气 = [0, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120, 125, 130, 135, 140, 145, 150, 155, 160, 165, 170, 175, 180, 185, 190, 195, 200, 205, 210, 215, 220, 225, 230, 235, 240, 245]
    # 基础值 41%
    幻影钝器 = [0, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120, 125, 130, 135, 140, 145, 150, 155, 160, 165, 170, 175, 180, 185, 190, 195, 200, 205, 210, 215, 220, 225, 230, 235, 240, 245]
    # 基础值 60%
    十字斩 = [0, 0, 6, 12, 18, 24, 30, 36, 42, 48, 54, 60, 66, 72, 78, 84, 90, 96, 102, 108, 114, 120, 126, 132, 138, 144, 150, 156, 162, 168, 174, 180, 186, 192, 198, 204, 210, 216, 222, 228, 234, 240, 246, 252, 258, 264, 270, 276, 282, 288, 294]
    # 流星之天剑
    流星之天剑 = [0, 4432, 4802, 5170, 5539, 5911, 6280, 6647, 7017, 7385, 7755, 8125, 8494, 8862, 9233, 9603, 9969, 10340, 10707, 11078, 11448, 11817, 12186, 12557, 12927, 13295, 13665, 14034, 14403, 14771, 15141, 15509, 15880, 16251, 16618, 16988, 17358, 17750, 18120, 18490, 18861, 19230, 19600, 19970, 20340, 20711, 21080, 21450, 21820, 22190, 22561]
    # 巨剑流星之天剑追加
    巨剑流星之天剑 = [0, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60]
    # 钝器冲击波
    钝器流星之天剑 = [0, 2746, 2977, 3209, 3437, 3671, 3901, 4136, 4368, 4596, 4830, 5061, 5293, 5524, 5753, 5987, 6219, 6449, 6682, 6911, 7144, 7375, 7609, 7841, 8070, 8303, 8534, 8764, 8997, 9226, 9458, 9691, 9924, 10157, 10385, 10618, 10849, 11083, 11315, 11544, 11774, 12008, 12239, 12472, 12702, 12933, 13167, 13397, 13629, 13859, 14091]
    # 太刀刺伤
    刺伤几率 = [0, 64, 67, 70, 73, 76, 79, 82, 85, 88, 91, 94, 97, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100]
    可附加的刺伤数量 = [0, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12]
    # 光剑冲击波
    光剑流星之天剑 = [0, 1838, 2119, 2398, 2678, 2957, 3236, 3514, 3795, 4075, 4353, 4635, 4914, 5192, 5473, 5752, 6031, 6310, 6592, 6869, 7149, 7431, 7707, 7987, 8266, 8547, 8825, 9105, 9385, 9666, 9943, 10222, 10504, 10781, 11061, 11342, 11618, 11899, 12179, 12459, 12737, 13018, 13297, 13578, 13858, 14134, 14416, 14694, 14973, 15254, 15534]

    def 天剑刺伤层数(self):
        return int(self.刺伤几率[self.等级]) / 100 * self.可附加的刺伤数量[self.等级]

    def 附加倍率(self, 技能):
        if 技能 == '破军升龙击':
            return (0.40 + self.暴风式冲击波[self.等级] / 100) * self.额外倍率
        elif 技能 == '猛龙断空斩':
            return (0.21 + self.飓风[self.等级] / 100) * self.额外倍率
        elif 技能 == '幻影剑舞斩击':
            return (0.55 + self.幻影斩击[self.等级] / 100) * self.额外倍率
        elif 技能 == '幻影剑舞剑气':
            return (0.55 + self.幻影剑气[self.等级] / 100) * self.额外倍率
        elif 技能 == '幻影剑舞钝器':
            return (0.41 + self.幻影钝器[self.等级] / 100) * self.额外倍率
        elif 技能 == '极神剑术破空斩':
            return 0.60 + self.十字斩[self.等级] / 100

    def 特殊技能加成(self, char, 武器类型):
        if self.等级 != 0:
            b = char.get_skill_by_name('破军升龙击')
            if b.等级 > 0:
                b.神剑术倍率 *= 1 + b.极神剑术占比(武器类型) * self.附加倍率('破军升龙击') / b.独立倍率

            b = char.get_skill_by_name('猛龙断空斩')
            if b.等级 > 0:
                b.神剑术倍率 *= 1 + b.极神剑术占比(武器类型) * b.旋风攻击次数 * \
                    self.附加倍率('猛龙断空斩') / b.独立倍率

            b = char.get_skill_by_name('幻影剑舞')
            if b.等级 > 0:
                k = b.极神剑术斩击占比(武器类型) * b.影子斩击次数 * self.附加倍率('幻影剑舞斩击')
                if char.武器类型 != '钝器':
                    剑气次数 = (4 if 武器类型 == '短剑' else 3)
                    k += b.极神剑术剑气占比(武器类型) * 剑气次数 * self.附加倍率('幻影剑舞剑气')
                else:
                    k += b.极神剑术剑气占比(武器类型) * 4.2 * self.附加倍率('幻影剑舞钝器')
                b.神剑术倍率 *= 1 + k / b.独立倍率

            b = char.get_skill_by_name('极神剑术破空斩')
            if b.等级 > 0:
                b.被动倍率 *= 1 + b.极神剑术占比(武器类型) * self.附加倍率('极神剑术破空斩')

            b = char.get_skill_by_name('极神剑术流星落')
            if b.等级 > 0:
                k = 3 * self.流星之天剑[self.等级] * b.流星之天剑倍率
                if 武器类型 == '太刀':
                    b.hit数 += 3
                    b.流星之天剑刺伤层数 = self.天剑刺伤层数()
                elif 武器类型 == '巨剑':
                    k *= 1 + self.巨剑流星之天剑[self.等级] / 100
                elif 武器类型 == '钝器':
                    k += 3 * 74  # 极神剑术.钝器流星之天剑[极神剑术.等级]
                elif 武器类型 == '光剑':
                    k += 3 * 74  # 极神剑术.光剑流星之天剑[极神剑术.等级]
                # 已知BUG,钝器光剑追加的额外天剑伤害极低,约只有74%
                # if self.版本 == 'GF':
                #     伤害整合 += temp / (1.2 if ('永恒不息之路[2]' in self.套装栏) else 1.0)
                # else:
                b.神剑术倍率 *= 1 + k * b.倍率 / b.等效百分比(武器类型=武器类型) / b.独立倍率

    自定义描述 = 1

    def 技能描述(self, 武器类型):
        temp = '常规技能攻击力 +%.1f%%' % (22 + 2 * self.等级) + '<br>'
        temp += '[破军升龙击]上斩：%.1f%%' % (self.附加倍率('破军升龙击') * 100) + '<br>'
        temp += '[猛龙断空斩]突进斩击：%.1f%%' % (self.附加倍率('猛龙断空斩') * 100) + '<br>'
        temp += '[幻影剑舞]斩击：%.1f%%' % (self.附加倍率('幻影剑舞斩击') * 100) + '<br>'
        if 武器类型 == '钝器':
            temp += '[幻影剑舞]钝器最后一击：%.1f%%' % (self.附加倍率('幻影剑舞钝器')
                                             * 100) + '<br>'
        else:
            temp += '[幻影剑舞]剑气：%.1f%%' % (self.附加倍率('幻影剑舞剑气') * 100) + '<br>'
        temp += '[极 · 神剑术 (破空斩)]爆炸：%.1f%%' % (self.附加倍率('极神剑术破空斩')
                                              * 100) + '<br>'
        temp += '流星之天剑攻击力：%.1f%%' % self.流星之天剑[self.等级]
        return temp


class 技能27(剑魂主动技能):
    名称 = '极神剑术瞬斩'
    所在等级 = 80
    等级上限 = 50
    学习间隔 = 2
    等级精通 = 40
    CD = 50
    MP = [800, 6000]
    无色消耗 = 5
    data0 = [0, 18910, 20827, 22745, 24663, 26581, 28500, 30421, 32337, 34258, 36175, 38092, 40010, 41929, 43848, 45765, 47683, 49601, 51519, 53439, 55358, 57275, 59194, 61112, 63031, 64949, 66870, 68784, 70707, 72620, 74542, 76460, 78378, 80296, 82215, 84132, 86050, 87972, 89886, 91808, 93725, 95645, 97559, 99481, 101398, 103314, 105234, 107152, 109069, 110988, 112910]
    hit0 = 1
    data1 = [0, 3094, 3408, 3717, 4034, 4348, 4663, 4976, 5291, 5604, 5916, 6232, 6547, 6861, 7173, 7489, 7802, 8115, 8430, 8744, 9057, 9372, 9687, 9998, 10314, 10629, 10940, 11255, 11570, 11884, 12198, 12512, 12823, 13137, 13451, 13766, 14081, 14393, 14710, 15022, 15336, 15650, 15962, 16279, 16594, 16904, 17220, 17535, 17844, 18160, 18477]
    hit1 = 5
    data2 = [0, 51569, 56802, 62033, 67265, 72498, 77731, 82961, 88194, 93424, 98657, 103890, 109120, 114351, 119583, 124817, 130048, 135279, 140510, 145743, 150979, 156209, 161441, 166673, 171904, 177137, 182364, 187599, 192831, 198064, 203295, 208529, 213760, 218992, 224224, 229456, 234686, 239918, 245148, 250382, 255615, 260847, 266076, 271311, 276539, 281772, 287006, 292237, 297467, 302702, 307931]
    hit2 = 1

    hit数 = 7
    是否有护石 = 1

    def 装备护石(self, char):
        self.倍率 *= 1.32


class 技能28(剑魂主动技能):
    名称 = '万剑归宗'
    所在等级 = 85
    等级上限 = 50
    学习间隔 = 5
    等级精通 = 40
    CD = 180
    MP = [2500, 5000]
    无色消耗 = 10
    # 该技能hit数不会触发太刀刺伤
    data0 = [0, 6846, 8441, 10031, 11615, 13207, 14798, 16382, 17976, 19560, 21145, 22744, 24328, 25913, 27499, 29095, 30683, 32267, 33855, 35453, 37037, 38621, 40212, 41798, 43391, 44982, 46569, 48154, 49751, 51337, 52920, 54506, 56106, 57688, 59275, 60865, 62451, 64046, 65631, 67226, 68809, 70399, 71991, 73578, 75160, 76748, 78343, 79930, 81515, 83103, 84701]
    hit0 = 14
    data1 = [0, 27364, 33713, 40063, 46412, 52746, 59096, 65444, 71797, 78136, 84488, 90835, 97185, 103522, 109869, 116220, 122567, 128912, 135260, 141608, 147946, 154294, 160644, 166992, 173340, 179681, 186030, 192375, 198716, 205069, 211415, 217762, 224109, 230454, 236800, 243148, 249490, 255838, 262189, 268536, 274883, 281222, 287572, 293920, 300264, 306612, 312958, 319307, 325647, 331996, 338343]
    hit1 = 2
    data2 = [0, 1478, 1820, 2164, 2508, 2848, 3188, 3536, 3875, 4219, 4564, 4903, 5245, 5588, 5931, 6274, 6616, 6959, 7301, 7644, 7987, 8329, 8672, 9016, 9357, 9702, 10042, 10383, 10727, 11069, 11414, 11757, 12098, 12443, 12785, 13125, 13469, 13814, 14155, 14495, 14838, 15185, 15524, 15865, 16212, 16551, 16894, 17240, 17581, 17923, 18266]
    hit2 = 1

    形态 = ['终结', '穿云']

    def 形态变更(self, 形态, char: Character):
        if 形态 == '' and len(self.形态) > 0:
            形态 = self.形态[0]
        if 形态 == "终结":
            self.hit0 = 14
            self.hit1 = 2
            self.hit2 = 0
        elif 形态 == "穿云":
            self.hit0 = 0
            self.hit1 = 0
            self.hit2 = 1


class 技能29(被动技能):
    名称 = '无形剑意'
    所在等级 = 95
    等级上限 = 50
    学习间隔 = 3
    等级精通 = 40

    关联技能 = ['所有']

    def 加成倍率(self, 武器类型):
        if self.等级 == 0:
            return 1.0
        else:
            return round(1.18 + 0.02 * self.等级, 5)

    短剑流心刺 = [0, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57, 60, 63, 66, 69, 72, 75, 78, 81, 84, 87, 90, 93, 96, 99, 102, 105, 108, 111, 114, 117, 120, 123, 126, 129, 132, 135, 138, 141, 144, 147, 150, 153, 156, 159, 162, 165, 168, 171, 174, 177]
    短剑流心刺空中 = [0, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118]
    太刀流心跃 = [0, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, 8, 8, 9, 9, 10, 10, 10, 11, 11, 12, 12, 12, 13, 13, 14, 14, 14, 15, 15, 16, 16, 16, 17, 17, 18, 18, 18, 19, 19, 20, 20, 20, 21, 21, 22, 22, 22, 23, 23, 24]
    太刀流心升 = [0, 12, 13, 14, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 40, 41, 42, 43, 44, 46, 47, 48, 49, 50, 52, 53, 54, 55, 56, 58, 59, 60, 61, 62, 64, 65, 66, 67, 68, 70, 71]
    钝器流心刺 = [0, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120, 125, 130, 135, 140, 145, 150, 155, 160, 165, 170, 175, 180, 185, 190, 195, 200, 205, 210, 215, 220, 225, 230, 235, 240, 245, 250, 255, 260, 265, 270, 275, 280, 285, 290, 295]
    巨剑流心刺下斩 = [0, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159]
    巨剑流心刺旋风 = [0, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107]
    巨剑流心刺空中 = [0, 357, 366, 375, 384, 393, 402, 411, 420, 429, 438, 447, 456, 465, 474, 483, 492, 501, 510, 519, 528, 537, 546, 555, 564, 573, 582, 591, 600, 609, 618, 627, 636, 645, 654, 663, 672, 681, 690, 699, 708, 717, 726, 735, 744, 753, 762, 771, 780, 789, 798]
    光剑流心升 = [0, 48, 53, 58, 62, 67, 72, 77, 82, 86, 91, 96, 101, 106, 110, 115, 120, 125, 130, 134, 139, 144, 149, 154, 158, 163, 168, 173, 178, 182, 187, 192, 197, 202, 206, 211, 216, 221, 226, 230, 235, 240, 245, 250, 254, 259, 264, 269, 274, 278, 283]

    自定义描述 = 1

    def 特殊技能加成(self, char, 武器类型):
        if self.等级 > 0:
            基础倍率 = self.加成倍率(武器类型)

            if 武器类型 == '短剑':
                流心刺 = char.get_skill_by_name('流心刺')
                流心刺.地面被动倍率['短剑'] = (
                    1 + 2 * (self.短剑流心刺[self.等级] / 100) / 3) / 基础倍率  # 地面2 + 1段
                流心刺.空中被动倍率['短剑'] = (
                    1 + 3 * (self.短剑流心刺空中[self.等级] / 100) / 2) / 基础倍率  # 空中2段

            elif 武器类型 == '太刀':
                流心跃 = char.get_skill_by_name('流心跃')
                流心升 = char.get_skill_by_name('流心升')

                流心跃.hit数 += 5
                流心跃.被动倍率 *= (
                    1 + (self.太刀流心跃[self.等级] / 100) * 5 / (2 * 0.5)) / 基础倍率

                流心升.hit数 += 4
                流心升.被动倍率 *= (
                    1 + 4 * (self.太刀流心升[self.等级] / 100) / (3 * 0.8)) / 基础倍率

            elif 武器类型 == '钝器':
                流心刺 = char.get_skill_by_name('流心刺')
                流心刺.被动倍率 *= (
                    1 + (self.钝器流心刺[self.等级] / 100) / (2 * 1.25)) / 基础倍率

            elif 武器类型 == '巨剑':
                流心刺 = char.get_skill_by_name('流心刺')
                # 基础：地面2 + 1段  加成后：地面1段(200%伤害) + 下斩1段 + 旋风3段
                流心刺.地面被动倍率['巨剑'] = (((2 + 1) * (self.巨剑流心刺下斩[self.等级] / 100) +
                                     (self.巨剑流心刺旋风[self.等级] / 100) * 3) / (2 + 1)) / 基础倍率
                流心刺.空中被动倍率['巨剑'] = (
                    (self.巨剑流心刺空中[self.等级] / 100) / 2) / 基础倍率  # 空中1段，伤害为200%

            elif 武器类型 == '光剑':
                流心升 = char.get_skill_by_name('流心升')
                流心升.被动倍率 *= (1 +
                             (self.光剑流心升[self.等级] / 100) / (3 * 0.8)) / 基础倍率

    def 技能描述(self, 武器类型):
        temp = '常规技能攻击力 +%.1f%%' % (18 + 2 * self.等级) + '<br>'
        if 武器类型 == '短剑':
            temp += '短剑流心刺：%.1f%%' % self.短剑流心刺[self.等级] + '<br>'
            temp += '短剑流心刺空中：%.1f%%' % self.短剑流心刺空中[self.等级] + ' i 3'
        elif 武器类型 == '太刀':
            temp += '太刀流心跃：%.1f%%' % self.太刀流心跃[self.等级] + ' i 5<br>'
            temp += '太刀流心升：%.1f%%' % self.太刀流心升[self.等级] + ' i 4'
        elif 武器类型 == '钝器':
            temp += '钝器流心刺：%.1f%%' % self.钝器流心刺[self.等级]
        elif 武器类型 == '巨剑':
            temp += '巨剑流心刺下斩：%.1f%%' % self.巨剑流心刺下斩[self.等级] + '<br>'
            temp += '巨剑流心刺旋风：%.1f%%' % self.巨剑流心刺旋风[self.等级] + ' i 3<br>'
            temp += '巨剑流心刺空中：%.1f%%' % self.巨剑流心刺空中[self.等级]
        elif 武器类型 == '光剑':
            temp += '光剑流心升：%.1f%%' % self.光剑流心升[self.等级]
        return temp


class 技能30(剑魂主动技能):
    名称 = '极神剑术无形斩'
    所在等级 = 95
    等级上限 = 50
    学习间隔 = 2
    等级精通 = 40
    CD = 60
    MP = [960, 7200]
    无色消耗 = 7
    data0 = [0, 28396, 31279, 34160, 37040, 39923, 42803, 45683, 48565, 51446, 54327, 57208, 60089, 62969, 65851, 68733, 71612, 74494, 77376, 80255, 83136, 86018, 88899, 91779, 94662, 97543, 100422, 103304, 106186, 109066, 111948, 114828, 117708, 120591, 123472, 126351, 129233, 132115, 134995, 137877, 140758, 143638, 146519, 149401, 152282, 155162, 158044, 160924, 163806, 166687, 169567]
    hit0 = 1
    data1 = [0, 4056, 4468, 4879, 5290, 5702, 6115, 6526, 6937, 7348, 7761, 8172, 8585, 8994, 9407, 9818, 10230, 10640, 11052, 11464, 11876, 12287, 12699, 13111, 13522, 13934, 14345, 14758, 15168, 15580, 15992, 16404, 16816, 17228, 17638, 18050, 18462, 18875, 19283, 19695, 20107, 20520, 20931, 21342, 21754, 22166, 22577, 22989, 23401, 23812, 24223]
    hit1 = 13
    data2 = [0, 54092, 59579, 65067, 70554, 76042, 81529, 87016, 92504, 97992, 103480, 108968, 114456, 119943, 125432, 130920, 136406, 141894, 147381, 152869, 158356, 163844, 169332, 174820, 180306, 185794, 191282, 196769, 202257, 207744, 213234, 218723, 224209, 229697, 235184, 240672, 246159, 251648, 257136, 262623, 268110, 273598, 279086, 284573, 290061, 295549, 301036, 306524, 312011, 317499, 322986]
    hit2 = 1

    hit数 = 15


class 技能31(剑魂主动技能):
    名称 = '万剑极诣开天斩'
    所在等级 = 100
    等级上限 = 50
    学习间隔 = 5
    等级精通 = 40
    CD = 290
    MP = [4028, 8056]
    无色消耗 = 15
    data0 = [0, 64289, 79198, 94105, 109013, 123920, 138828, 153735, 168643, 183550, 198459, 213365, 228274, 243180, 258088, 272997, 287905, 302813, 317721, 332628, 347534, 362443, 377350, 392259, 407165, 422074, 436982, 451888, 466796, 481704, 496611, 511519, 526427, 541336, 556239, 571149, 586055, 600963, 615872, 630780, 645686, 660595, 675503, 690410, 705319, 720225, 735133, 750040, 764949, 779857, 794763]
    hit0 = 1
    data1 = [0, 84071, 103564, 123059, 142556, 162050, 181543, 201038, 220534, 240027, 259522, 279016, 298511, 318007, 337502, 356995, 376490, 395987, 415482, 434976, 454468, 473964, 493460, 512954, 532449, 551943, 571436, 590931, 610427, 629920, 649416, 668910, 688406, 707899, 727392, 746890, 766383, 785878, 805375, 824867, 844359, 863857, 883352, 902845, 922341, 941836, 961330, 980825, 1000320, 1019814, 1039309]
    hit1 = 1
    data2 = [0, 11538, 14214, 16890, 19564, 22242, 24916, 27593, 30268, 32946, 35621, 38295, 40972, 43648, 46324, 48999, 51675, 54350, 57026, 59702, 62376, 65052, 67730, 70407, 73079, 75757, 78432, 81107, 83782, 86460, 89133, 91809, 94484, 97159, 99836, 102513, 105190, 107865, 110541, 113216, 115890, 118567, 121243, 123919, 126595, 129270, 131946, 134622, 137297, 139973, 142649]
    hit2 = 6
    data3 = [0, 15824, 19495, 23162, 26833, 30503, 34172, 37843, 41511, 45182, 48851, 52519, 56190, 59859, 63527, 67199, 70868, 74539, 78208, 81878, 85546, 89215, 92885, 96554, 100225, 103895, 107565, 111234, 114906, 118572, 122243, 125912, 129579, 133252, 136920, 140587, 144260, 147928, 151597, 155269, 158938, 162607, 166277, 169947, 173615, 177286, 180955, 184624, 188294, 191964, 195634]
    hit3 = 5
    data4 = [0, 197814, 243682, 289553, 335422, 381293, 427162, 473032, 518903, 564772, 610643, 656512, 702383, 748252, 794122, 839991, 885862, 931732, 977602, 1023469, 1069340, 1115210, 1161080, 1206950, 1252821, 1298689, 1344560, 1390429, 1436300, 1482169, 1528039, 1573908, 1619779, 1665650, 1711518, 1757390, 1803259, 1849126, 1895000, 1940869, 1986737, 2032608, 2078478, 2124348, 2170218, 2216087, 2261956, 2307826, 2353696, 2399566, 2445436]
    hit4 = 1

    hit数 = 14


class classChange(Character):
    def __init__(self, equVersion=""):
        self.实际名称 = 'weapon_master'
        self.名称 = '极诣·剑魂'
        self.角色 = '鬼剑士(男)'
        self.类型 = '输出'
        self.职业 = '剑魂'
        self.武器选项 = ['光剑', '太刀', '钝器', '巨剑', '短剑']
        self.输出类型选项 = ['物理百分比']
        self.防具精通属性 = ['力量']
        self.类型 = '物理百分比'
        self.武器类型 = '光剑'
        self.防具类型 = '轻甲'
        self.get_skill_by_name
        技能列表 = []
        技能序号 = {}
        i = 0
        while i >= 0:
            try:
                tem = eval('技能'+str(i)+'()')
                tem.基础等级计算()
                技能序号[tem.名称] = i
                技能列表.append(tem)
                i += 1
            except:
                i = -1
        self.技能栏 = 技能列表
        self.技能序号 = 技能序号
        self.buff = 1.82

        super().__init__(equVersion)

    def 被动倍率计算(self):
        # 武器奥义、精通相关
        武器奥义 = self.get_skill_by_name('武器奥义')
        if 武器奥义.等级 != 0:
            for i in ['太刀精通', '短剑精通', '巨剑精通', '光剑精通', '钝器精通']:
                if self.get_skill_by_name(i).等级 != 0:
                    self.get_skill_by_name(i).等级 += (武器奥义.等级 + 1)
                if self.武器类型 not in i:
                    self.get_skill_by_name(i).关联技能 = ['无']

        super().被动倍率计算()

        # 无形剑意流系技能
        无形剑意 = self.get_skill_by_name('无形剑意')
        无形剑意.特殊技能加成(self, self.武器类型)

        # 极神剑术相关
        极神剑术 = self.get_skill_by_name('极神剑术')
        极神剑术.特殊技能加成(self, self.武器类型)

        # 里鬼剑术附加
        里鬼剑术 = self.get_skill_by_name('里鬼剑术')
        里鬼剑术.特殊技能加成(self, self.武器类型)

    def 伤害计算(self):
        data = super().伤害计算()
        skill_dict = data['skills']

        神剑术伤害 = 0
        count = 0
        attack_rate = 0

        # region 神剑术

        for skill in ['破军升龙击', '猛龙断空斩', '幻影剑舞', '极神剑术流星落']:
            if skill in skill_dict.keys():
                temp = self.get_skill_by_name(skill)
                count += skill_dict[skill]['count']
                神剑术伤害 += skill_dict[skill]['damage']*(temp.神剑术倍率-1)
                attack_rate = (
                    attack_rate + skill_dict[skill]['atk_rate']*skill_dict[skill]['count']*(temp.神剑术倍率-1))/count

        if 神剑术伤害 > 0:
            神剑术 = self.get_skill_by_name('极神剑术')
            data['skills']['极神剑术'] = {
                'name': '极神剑术',
                'rate': 1.0,
                'cd': 1.0,
                'mp': 0,
                'damage': 神剑术伤害,
                'count': count,
                'level': 神剑术.等级,
                'cosume_cube_frag': 0,
                'cd_o': 1.0,
                'atk_rate': attack_rate
            }
            data['total_data'] += 神剑术伤害

        # endregion

        # region 太刀刺伤
        if self.武器类型 == '太刀':
            b = self.get_skill_by_name("太刀精通")
            if b.等级 > 0:
                总hit = 0
                for key in data['skills'].keys():
                    d = data['skills'][key]
                    i = self.get_skill_by_name(d['name'])
                    if i.是否主动 == 1:
                        释放次数 = d['count']
                        总hit += i.hit数 * 释放次数
                        b.刺伤层数 += i.额外刺伤层数(self.武器类型) * 释放次数

                b.刺伤层数 += 总hit * b.刺伤概率(self.武器类型)

                被动倍率 = 1.0
                for name in ['光剑精通', '短剑精通', '巨剑精通', '太刀精通', '钝器精通', '无我剑气', '极鬼剑术斩铁式', '无形剑意']:
                    被动倍率 *= self.get_skill_by_name(name).加成倍率(self.武器类型)

                倍率 = b.刺伤百分比(self.武器类型) * 被动倍率

                count = round(b.刺伤层数 / 17, 1)
                damage = 倍率 * self.伤害指数 * (self.伤害比例.get("直伤", 0.0)) / 100
                from core.basic.equipment import get_global_data
                for item in ['中毒', '灼伤', '感电', '出血']:
                    cur = item
                    pa = ''
                    if item == '中毒':
                        pa = 'zd_rate'
                    if item == '出血':
                        pa = 'cx_rate'
                    if item == '感电':
                        pa = 'gd_rate'
                    if item == '灼伤':
                        pa = 'zs_rate'
                    if item == '灼伤' and '灼伤' in get_global_data("state_type", self.equVersion) and ('冰冻' in get_global_data("get_state_type", self.equVersion) or ('冰冻' in get_global_data("state_type", self.equVersion) and self.check_equ_by_name("永眠前的准备"))):
                        pa = 'zs_bd_rate'
                        cur = '灼伤破冰'
                    保有率 = 0
                    异常基础加成 = 1.0
                    异常结算加成 = 1.0
                    装备加成异常结算 = 1.0
                    if pa == 'zs_bd_rate':
                        保有率 = self.异常保有率计算(pa,cur)
                        异常基础加成 = 1.0
                        异常结算加成 = self.异常基础加成['灼伤破冰']
                        装备加成异常结算 = self.异常结算加成.get(cur,1.0)
                    else:
                        保有率 = self.异常保有率计算(pa,cur)
                        # 叠层处理
                        异常基础加成 = 1+ (self.异常基础加成.get(cur,1.0)-1) * get_global_data(pa,self.equVersion,1.0)
                        异常结算加成 = 1.0
                        装备加成异常结算 = self.异常结算加成.get(cur,1.0)
                    系数 = self.伤害系数.get(item, 0.0) * ( (1-保有率) * 异常基础加成 + 保有率 * 异常基础加成 * 异常结算加成 * 装备加成异常结算)
                    damage += 系数 * 倍率 * self.伤害指数 * (self.伤害比例.get(item, 0.0)) / 100
                from core.basic.equipment import get_global_data
                data['skills']['太刀精通'] = {
                    'name': '太刀精通',
                    'rate': 被动倍率,
                    'cd': 0,
                    'mp': 0,
                    'damage': damage,
                    'count': count,
                    'level': b.等级,
                    'cosume_cube_frag': 0,
                    'cd_o': 0,
                    'atk_rate': b.刺伤浮动
                }
            data['total_data'] += damage
        # endregion

        dps = 0
        for temp in data['skills']:
            skill = data['skills'][temp]
            try:
                dps += (skill['damage']/skill['count'])/skill['cd']
            except:
                pass
        data['dps'] = dps
        return data

        # 神影手
        '''
        if self.技能栏[self.技能序号['拔刀斩']].触发神影手 == 1 and 技能总伤害[self.技能序号['拔刀斩']] != 0:

            技能释放次数[self.技能序号['神影手']] = 技能释放次数[self.技能序号['拔刀斩']]

            神影手倍率 = 1.0

            for name in ['光剑精通', '短剑精通', '巨剑精通', '太刀精通', '钝器精通']:
                神影手倍率 *= self.技能栏[self.技能序号[name]].加成倍率(self.武器类型)

            比例 = self.技能栏[self.技能序号['神影手']].百分比 * self.伤害指数 * \
                神影手倍率 / self.主BUFF / 技能单次伤害[self.技能序号['拔刀斩']]

            技能总伤害[self.技能序号['神影手']] = 比例 * 技能总伤害[self.技能序号['拔刀斩']]
        '''

    def 技能倍率加成(self, min: int, max: int, x: float, exc=[], type="all",excName=[]) -> None:
        for i in self.技能栏:
            if i.所在等级 >= min and i.所在等级 <= max and i.所在等级 not in exc and i.名称 not in excName:
                if i.是否有伤害 == 1:
                    if type == "all" or (type == "active" and i.是否主动 == 1):
                        i.倍率 *= (1 + x * self.技能伤害增加增幅)
                if type == "all" and min == 75 and i.名称 == '极神剑术':
                    i.额外倍率 *= (1 + x * self.技能伤害增加增幅)
                if i.名称 in ['破军升龙击', '猛龙断空斩', '幻影剑舞', '极神剑术流星落'] and min == max:
                    i.独立倍率 *= (1 + x * self.技能伤害增加增幅)

    def set_skill_info(self, info, rune_except=[], clothes_pants=[]):
        super().set_skill_info(info, clothes_pants=[
            '太刀精通', '短剑精通', '巨剑精通', '钝器精通'])

    def 技能等级加成(self, 加成类型: str, min: int, max: int, lv: int, exc=[],excName=[]) -> None:
        for i in self.技能栏:
            if i.所在等级 >= min and i.所在等级 <= max and i.所在等级 not in exc  and i.名称 not in excName and i.名称 not in ['光剑精通','太刀精通', '巨剑精通', '短剑精通', '钝器精通']:
                if 加成类型 == '所有':
                    i.等级加成(lv, char=self)
                else:
                    if (i.是否主动 == 1) == (加成类型 == '主动'):
                        i.等级加成(lv, char=self)
        # super().技能等级加成(加成类型, min, max, lv, exc)

    def get_acitve_skill_detail(self, skill, temp_info, temp_char, weapon, ratio, skill_info):
        if skill.是否有伤害:
            if len(skill.形态) == 0:
                skill.形态 = ['']
            for 形态 in skill.形态:
                original = 0
                for i in ['直伤', '中毒', '灼伤', '感电', '出血']:
                    original += skill.等效百分比(
                        char=temp_info, 武器类型=weapon, 形态=形态, 伤害类型=i)
                skill_info["skills_active"].append({
                    "name": skill.名称,
                    "need_level": skill.所在等级,
                    "lv": skill.等级,
                    "data": original*ratio*skill.被动倍率*skill.神剑术倍率,
                    "cd": skill.等效CD(武器类型=weapon, 输出类型=temp_info.类型),
                    "mode": 形态,
                    "cost": skill.无色消耗,
                    "tp": skill.TP等级
                })
                if skill.是否有护石 == 1:
                    temp = temp_char.get_skill_by_name(skill.名称)
                    cp = 0
                    for i in ['直伤', '中毒', '灼伤', '感电', '出血']:
                        cp += temp.等效百分比(char=temp_char,
                                         武器类型=weapon, 形态=形态, 伤害类型=i)
                    skill_info["skills_cp"].append({
                        "name": skill.名称,
                        "need_level": skill.所在等级,
                        "lv": skill.等级,
                        "data": cp*ratio*temp.被动倍率*temp.神剑术倍率,
                        "cd": temp.等效CD(武器类型=weapon, 输出类型=temp_info.类型),
                        "original_data": original*ratio*skill.被动倍率*skill.神剑术倍率,
                        "original_cd": skill.等效CD(武器类型=weapon, 输出类型=temp_info.类型),
                        "mode": 形态,
                        "cost": temp.无色消耗,
                        "tp": skill.TP等级
                    })
                pass
            pass
